#ifndef __MYSQL_OP_H__
#define __MYSQL_OP_H__

#include "/usr/include/mysql/mysql.h"
#include "head.h"
#include "getid.h"

#define OPEN_MYSQL(myconnect) \
do{\
    MYSQL myconnect;\
    mysql_init(&myconnect);\
    if(mysql_real_connect(&myconnect,"localhost","root","185463","project",0,NULL,CLIENT_FOUND_ROWS))\
    { \
        printf("数据库连接成功\n")


#define CLOSE_MYSQL(myconnect) \
        mysql_close(&myconnect);\
        printf("数据库连接关闭\n");\
    }\
}while(0)


int getUsrId(char *username);
int InsertVirtualFile(MYSQL *mysql, char *value);
char* GetPwd(MYSQL* mysql,int userid);
char* Getmd5(MYSQL mysql,int userid,char* filename);
int ExitFile(MYSQL* mysql,char* filename,int userid,int pid);//判断是否重复文件

#endif
